using System;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;

namespace FormsGenerator.Controls
{
	/// <summary>
	///		Summary description for showHelpBox.
	/// </summary>
	public partial class ShowHelpBox : System.Web.UI.UserControl
	{
		protected void Page_Load(object sender, System.EventArgs e)
		{
			// Put user code to initialize the page here
			Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "clientScript", "<script language=\"JavaScript\" src=\"Script/ShowHelp.js\")></script>");
		}

		public static string AddOnmousePopupHelp(string strHelpText)
		{
			return AddOnmousePopupHelp("helpBox", "helptext", strHelpText);
		}

		public static string AddOnmousePopupHelp(string strHelpID, string strHelpTextID, string strHelpText)
		{
			if (strHelpText != null && !strHelpText.Equals(""))
				return "onmouseover=\"showHelpBox('" + strHelpID + "', '" + strHelpTextID + "', '" + strHelpText + "')\" onmouseout=\"hideHelpBox('" + strHelpID + "')\" onmousemove=\"showHelpBox('" + strHelpID + "', '" + strHelpTextID + "', '" + strHelpText + "')\"";
			else
				return "";
		}

		public static void AddOnmousePopupHelp(string strHelpText, WebControl control)
		{
			AddOnmousePopupHelp("helpBox", "helptext", strHelpText, control);
		}

		public static void AddOnmousePopupHelp(string strHelpID, string strHelpTextID, string strHelpText, WebControl control)
		{
			//if (!( strHelpText.Equals(null) || strHelpText.Equals("") ) )
			if (strHelpText != null && !strHelpText.Equals(""))
			{
				control.Attributes.Add("onmouseover", "showHelpBox('" + strHelpID + "', '" + strHelpTextID + "', '" + strHelpText + "')");
				control.Attributes.Add("onmouseout", "hideHelpBox('" + strHelpID + "')");
				control.Attributes.Add("onmousemove", "showHelpBox('" + strHelpID + "', '" + strHelpTextID + "', '" + strHelpText + "')");
			}
		}

		public static void AddOnmousePopupHelp(string strHelpText, HtmlControl control)
		{
			AddOnmousePopupHelp("helpBox", "helptext", strHelpText, control);
		}

		public static void AddOnmousePopupHelp(string strHelpID, string strHelpTextID, string strHelpText, HtmlControl control)
		{
			//if (!( strHelpText.Equals(null) || strHelpText.Equals("") ) )
			if (strHelpText != null && !strHelpText.Equals(""))
			{
				control.Attributes.Add("onmouseover", "showHelpBox('" + strHelpID + "', '" + strHelpTextID + "', '" + strHelpText + "')");
				control.Attributes.Add("onmouseout", "hideHelpBox('" + strHelpID + "')");
				control.Attributes.Add("onmousemove", "showHelpBox('" + strHelpID + "', '" + strHelpTextID + "', '" + strHelpText + "')");
			}
		}

		
	}
}